package com.cy2;

import java.io.*;

public class CopeJavaDemo {
    public static void main(String[] args) throws IOException {
        InputStreamReader ism = new InputStreamReader(new FileInputStream("myCharStream\\ConversionStreamDemo.java"));
        OutputStreamWriter osm = new OutputStreamWriter(new FileOutputStream("myCharStream\\Cope.java"));
//  一次写一个字符      int ch;
//        while((ch=ism.read())!=-1){
//            osm.write(ch);
//        }
        //一次写一个字符数组
       char[] bys=new char[1024];
       int len;
       while((len=ism.read(bys))!=-1){
           osm.write(bys,0,len);
       }
        ism.close();
        osm.close();

    }
}
